package com.coolt.client.components;

import java.util.List;

import com.coolt.client.Labels;
import com.coolt.client.Util;
import com.coolt.client.model.Item;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;

public class SelecaoAno extends VerticalPanel {

	private Labels labelsConstants = GWT.create(Labels.class);
	private Util util = new Util();

	public SelecaoAno(List<Item> listaItens) {

		setStyleName("frames");
		setSize("300", "300");

		add(Util.tituloFramesHome(labelsConstants.inicioSelecaoAno()));

		HorizontalPanel hp = new HorizontalPanel();
		for (int i = 0; (i < listaItens.size() && i < 6); i++) {
			if ((i % 3) == 0) {
				hp = new HorizontalPanel();
				add(hp);
			}
			hp.add(util.itemImageNome(listaItens.get(i)));
		}
	}

}
